package com.breeze.jetpackproject;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.breeze.jetpackproject.lifecycle.DemoActivity;
import com.breeze.jetpackproject.livedata.Demo1Activity;
import com.breeze.jetpackproject.viewmodel.Demo2Activity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void startLifeCycle(View view) {
        start(DemoActivity.class);
    }

    public void startLiveData(View view) {
        start(Demo1Activity.class);
    }

    public void startViewModel(View view) {
        start(Demo2Activity.class);
    }

    public void start(Class<?> cls) {
        startActivity(new Intent(this, cls));
    }
}